package om.myjava.Linkedlist;

import java.util.LinkedList;

class Stack{
    LinkedList list;
     Stack(){
           list = new LinkedList();

     }
    void push(Object obj){
         list.addLast(obj);
    }
    void pop(){
         list.removeLast();
    }

    @Override
    public String toString() {
        return  list.toString() ;
    }
}
public class StackClass {
    public static void main(String[] args) {
        Stack s = new Stack();
        s.push("a");
        s.push("b");
        s.push("c");
        System.out.println(s);
        s.pop();
        System.out.println(s);
    }

}
